package com.ynny.blockhandler;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.stereotype.Component;
//热点限流
//BlockException作用: 当被限流或者降级时，会抛出BlockException, 我们可以通过BlockException.getRule()获取限流规则。
@Component
public class HotspotBlockHandler {
    public static String getHotspotBlockHandler(String type,
                                                String name,
                                                BlockException e) {
        System.out.println("热点限流,请稍后再试");
        System.out.println("--------------");
        return "热点限流,请稍后再试";
    }
}
